<template>
  <div>
    <!-- input被修改时触发 -->
    <input type="text" :value="dates" @input="ipt" />
    <!-- 失去焦点触发change事件 -->
    <!-- <input type="text" :value="dates" @change="ipt" /> -->
    <!-- 代码逻辑较少一行搞定 -->
    <!-- <input type="text" :value="text" @input="text = $event.target.value" /> -->
    <!-- <input type="text" @change="text = $event.target.value" :value="text" /> -->
  </div>
</template>

<script>
export default {
  name: 'App',
  components: {},
  props: {},
  data() {
    return {
      dates: '加油',
      text: '刚把得斯卡',
    }
  },
  computed: {},
  watch: {},
  created() {},
  methods: {
    // 失去焦点触发change事件
    ipt(e) {
      console.log(e.target.value)
      this.dates = e.target.value
    },
  },
}
</script>

<style scoped></style>
